using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Text;
using System.Configuration;

using BizElements.BusinessLayer;

namespace BizElements.Web
{
    #region ButtonColumn - commented.

    ///// <summary>
    ///// <b>Experimental. Do not use.</b>
    ///// </summary>
    //public class ButtonColumn : TemplateColumn
    //{
    //    private class ButtonTemplate : ITemplate
    //    {
    //        string text;
    //        string dataKeyField;
    //        EventHandler onClick;

    //        public ButtonTemplate(string text, EventHandler onClick, string dataKeyField)
    //        {
    //            this.text = text;
    //            this.onClick = onClick;
    //            this.dataKeyField = dataKeyField;
    //        }

    //        public void InstantiateIn(Control container)
    //        {
    //            Button btn = new Button();                
    //            btn.Click += onClick;
    //            btn.DataBinding += new EventHandler(this.BindButton);

    //            container.Controls.Add(btn);
    //        }

    //        private void BindButton(object sender, EventArgs e)
    //        {
    //            Button btn = (Button)sender;
    //            btn.Text = this.text;

    //            DataGridItem currentItem = (DataGridItem)btn.NamingContainer;
    //            string itemId = DataBinder.Eval(currentItem.DataItem, this.dataKeyField).ToString();
    //            btn.CommandArgument = itemId;
    //        }
    //    }

    //    /// <summary>
    //    /// Initializes a new instance of the <b>ButtonColumn</b> class.
    //    /// </summary>
    //    /// <param name="text">Text caption displayed in the <see cref="Button"/> controls created by this template.</param>
    //    /// <param name="onClick"><see cref="EventHandler"/> invoked when the button is clicked.</param>
    //    /// <param name="dataKeyField">The key field in the data-source of a parent <b>DataGrid</b> control.</param>
    //    public ButtonColumn(string text, EventHandler onClick, string dataKeyField)
    //    {
    //        this.EditItemTemplate = new ButtonTemplate(text, onClick, dataKeyField);
    //        this.ItemTemplate = new ButtonTemplate(text, onClick, dataKeyField);
    //    }
    //}

    #endregion
}
